package com.isoft.hospital.dao;

import com.isoft.hospital.entity.Inhospital;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface InhospitalDao {
    @Select("select * from inhospital")
    List<Inhospital> selectAll();

    @Insert("insert into inhospital(ba_id,bf_id,zhtime,chtime,p_id,d_id) values(#{ba_id},#{bf_id},#{zhtime},#{chtime},#{p_id},#{d_id})")
    int insert(Inhospital inhospital); //与Impl关联

    @Delete("delete from inhospital where ba_id=#{ba_id}")
    int delete(int ba_id);

    @Update("update  inhospital set bf_id=#{bf_id},zhtime=#{zhtime},chtime=#{chtime},p_id=#{p_id},d_id=#{d_id} where ba_id=#{ba_id}")
    int update(Inhospital inhospital);
}
